<template>
<div class="header">
    <h1>我是头部</h1>
    <p>count的值是{{this.$store.state.count}}</p>
    <p>价格是{{price}}</p>
</div>
</template>

<script>
import { mapState } from "vuex";

export default {
  name: "Header",
  computed:{
    ...mapState(['count','price'])
  }
};
</script>

<style scoped>
.header {
  margin: 30px;
  background: yellowgreen;
}
</style>